package com.greateamd.timetableasy.client.widgets;

import com.google.gwt.uibinder.client.UiConstructor;
import com.greateamd.timetableasy.client.domain.AuthType;

public class AuthListBox extends ListBox 
{
	public @UiConstructor AuthListBox() {
		for(AuthType auth : AuthType.values())
			addItemIfNotPresent(auth.name());
	}
	
	public AuthType getSelectedAuthType(){
		if(getSelectedIndex() == -1)
			return null;
		return AuthType.valueOf(getItemText(getSelectedIndex()));
	}
}
